import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function getUser() {
  return request({
    url: '/user/getUser',
    method: 'get'
  })
}

export function getUserByPage(params) {
  return request({
    url: '/user/queryAllByPage',
    method: 'get',
    params
  })
}

export function updatePassword(data) {
  return request({
    url: '/user/updatePassword',
    method: 'post',
    data
  })
}

/**
 * 增加用户
 */
export function addUser(data) {
  return request({
    url: '/user/add',
    method: 'post',
    data
  })
}

/**
 *更新用户
 */
export function updateUser(data) {
  return request({
    url: '/user/update',
    method: 'post',
    data
  })
}

/**
 *
 * @param 删除的对象
 * @returns {AxiosPromise}
 */
export function deletes(data) {
  return request({
    url: 'user/deletes',
    method: 'delete',
    data
  })
}
